<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:include="common/template :: res(title='其他操作')">
	
</head>
<body style="padding-left:5px;">
<script type="text/javascript">
		$(function(){
			
			
			$('#formSubimt').click(function(){
				
				doRequest({
					type:'POST',
					url:'freeze',
					data:{
						bizType:$('#bizType').val(),
						ipsAcctNo:$('#ipsAcctNo').val(),
						projectNo:$('#projects').val(),
						trdAmt:$('#trdAmt').val(),
						merFee:$('#merFee').val(),
						userMobile:$('#userMobile').val()
					}
				},function(data){
					$('#merchantID').val(data.merchantID);
					$('#sign').val(data.sign);
					$('#request').val(data.requestBody);
					$('#submitForm').submit();
				});
			});
			
			$('#ipsAcctNo').change(function() {
				var _selected=$(this).find("option:selected");
				var mobile=_selected.data('mobile');
				$('#userMobile').val(mobile);
			});
			
			userTypeAction();
			projectAction();
		});
		
		function userTypeAction(){
			

			doRequest({
				url:'users'
			},function(data){
				console.log(data);
				var html ='<option> </option>';
				
				$(data).each(function(index,d){
					var showInfo = d.enterName?d.enterName:'个人';
					html +=('<option value="'+d.ipsAcctNo+'" data-mobile="'+d.mobileNo+'">'+d.realName+'-'+showInfo+'</option>');
				});
				$('#ipsAcctNo').html(html);
			});
		}
		
		function projectAction(){
			

			doRequest({
				url:'q/project'
			},function(data){
				console.log(data);
				var html ='';
				
				$(data).each(function(index,d){
					html +=('<option value="'+d.projectNo+'">'+d.projectName+'</option>');
				});
				$('#projects').html(html);
			});
		}
	</script>
	<div class="alert alert-success toptips" role="alert" id="js_tooltips"  style="display:none;z-index:100;">信息展示窗口</div>
	<div class="page-header">
	<h2>江苏亦融在线  <small>支付调试</small></h2>

	</div>
<ol class="breadcrumb">
  <li ><a href="index">首页</a> </li>
  <li class="active">其他操作</li>
</ol>
	<div class="form-horizontal" style="padding-left:20px;" >
		<div class="form-group">
			<label >操作类型</label>
			
				<select class="combobox" id="bizType"  style="width:100px;"> 
					<option value="1"> 投标</option>
					<option value="3"> 还款</option>
					<option value="4"> 分红</option>
					<option value="6"> 代偿还款</option>
				</select>
			
		</div>
		<div class="form-group">
			<label >操作方用户 </label> 
			<select class="combobox" id="ipsAcctNo"   > </select>
			<label>测试方便投标请选择个人</label>
		</div>
		<div class="form-group">
			<label >用户手机号</label> 
			<input type="text" class="form-control"	id="userMobile"/>
		</div>
		<div class="form-group">
			<label >项目名称</label> 
			<select class="combobox" id="projects"  style="width:200px;"> </select>
		</div>
		<div class="form-group">
			<label >操作金额</label> <input type="text" class="form-control"
				id="trdAmt" value="100"/>
		</div>
		<div class="form-group">
			<label >平台手续费</label> <input type="text"
				class="form-control" id="merFee"  value="0"/>
		</div>
		
		
		<div class="form-group">
			
				<button  class="btn btn-default" id="formSubimt">提交</button>
			
		</div>
	</div>
<div style="display: none;">
		<form action="http://180.168.26.114:20010/p2p-deposit/gateway.htm" method="post" id="submitForm"  target="_blank">
		
			<input type="text" name="operationType" id="operationType" value="trade.freeze"/>
			<input type="text" name="merchantID" id="merchantID"/>
			<input type="text" name="sign" id="sign"/>
			<input type="text" name="request" id="request"/>
		</form>
	</div>
	
</body>
</html>